package Experiment1;

import org.junit.jupiter.api.Test;

import java.util.ArrayList;

import static org.junit.jupiter.api.Assertions.*;

/**
 * Created by zhangyunqi on 2017/9/26.
 */
class ArrayListDemoTest1 {
    ArrayList list = new ArrayList ();
    @Test
    void isEmpty() {
        assertEquals ( true, list.isEmpty () );
        list.add ( "07shiyan3" );
        assertEquals ( false, list.isEmpty () );
        list.remove ( "07shiyan3" );
        assertEquals ( true, list.isEmpty () );
        list.add ( "07shiyan3" );
    }

    @Test
    void add() {
        list.add ( "20162307shiyan3" );
        assertEquals ( "20162307shiyan3", list.get (0) );
    }

    @Test
    void remove() {
        list.add ( "20162307shiyan3" );
        assertEquals (1, list.size () );
        list.remove ( "20162307shiyan3" );
        assertEquals (0, list.size () );
    }

}